package com.example.zookeeper.rmi.service;

import com.example.zookeeper.rmi.service.impl.HelloServiceImpl;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;

public class RmiSergvice
{
    public static void main(String[] args) throws RemoteException, MalformedURLException
    {
        int port = 1099;
        String uri = "rmi://localhost:1099/com.example.zookeeper.rmi.service.HelloService.HelloServiceImpl";
        LocateRegistry.createRegistry(port);
        Naming.rebind(uri,new HelloServiceImpl());
    }
}
